package com.abvnet.project.water.customer.controller;

import com.abvnet.common.utils.security.ShiroUtils;
import com.abvnet.framework.web.controller.BaseController;
import com.abvnet.framework.web.page.TableDataInfo;
import com.abvnet.project.water.project.domain.ProjectLog;
import com.abvnet.project.water.project.service.IProjectLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/customer/projectLog")
public class CustomerProjectLogController extends BaseController {

    private String prefix = "customer/projectLog";

    @Autowired
    private IProjectLogService projectLogService;

    @GetMapping()
    public String projectLog()
    {
        return prefix + "/list";
    }

    /**
     * 查询项目日志列表
     */
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list(ProjectLog projectLog) {
        projectLog.setDeptId(ShiroUtils.getSysUser().getDeptId());
        startPage();
        List<ProjectLog> list = projectLogService.selectCustomerProjectLogList(projectLog);
        return getDataTable(list);
    }
}
